import request from "@/utils/request";

// 查询模板主记录列表 (分页)
export function selectPageTemplateMaster(query) {
    return request({
        url: "/business/templateMaster/selectPage",
        method: "get",
        params: query,
    });
}

// 查询模板主记录列表 (不分页)
export function listTemplateMaster(query) {
    return request({
        url: "/business/templateMaster/list",
        method: "get",
        params: query,
    });
}

// 查询模板主记录详细
export function getTemplateMaster(templateMasterId) {
    return request({
        url: "/business/templateMaster/" + templateMasterId,
        method: "get",
    });
}

// 新增模板主记录
export function addTemplateMaster(data) {
    return request({
        url: "/business/templateMaster",
        method: "post",
        data: data,
    });
}
// 新增保存模板主记录和明细
export function saveMasterAndDetail(data) {
    return request({
        url: "/business/templateMaster/saveMasterAndDetail",
        method: "post",
        data: data,
    });
}

// 修改模板主记录
export function updateTemplateMaster(data) {
    return request({
        url: "/business/templateMaster",
        method: "put",
        data: data,
    });
}

// 删除模板主记录
export function delTemplateMaster(templateMasterId) {
    return request({
        url: "/business/templateMaster/" + templateMasterId,
        method: "delete",
    });
}


/**
 * 药品导入
 *
 * @param data
 */
export function batchImportImportRecordTemplate(data) {
  return request({
    url: '/business/templateMaster/importRecordTemplate',
    method: 'post',
    responseType: 'blob',
    // mask: true,
    headers: {'Content-Type': 'multipart/form-data'},
    data
  });
}

// 新增救护记录保存模板主记录和明细
export function saveAmbulanceStationMasterAndDetail(data) {
    return request({
        url: "/business/templateMaster/saveAmbulanceStationMasterAndDetail",
        method: "post",
        data: data,
    });
}
